package cn.bdqn.t354.controller;

import cn.bdqn.t354.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Value("${name}")
    private String name;
    @Value("${age}")
    private Integer age;


    @Autowired
    User user;

    @RequestMapping("/hello")
    public String hello(){
        return "hello world spring boot"+name+","+age;
    }


    @RequestMapping("/hello2")
    public String hello2(){
        return "hello world spring boot"+user.getName()+","+user.getAge();
    }
}
